home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4616 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  918 b 

  1. Path: strudel.rs.itd.umich.edu!davidm
  2. From: davidm@umich.edu (David Miller)
  3. Newsgroups: comp.lang.c
  4. Subject: Logical exclusive-or
  5. Date: 6 Feb 1996 04:36:10 GMT
  6. Organization: University of Michigan
  7. Message-ID: <4f6lrq$bcr@lastactionhero.rs.itd.umich.edu>
  8. NNTP-Posting-Host: strudel.rs.itd.umich.edu
  9. NNTP-Posting-User: 40746
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Is there a good reason why C doesn't have a logical exclusive-or
  13. operator?  A look at the precedence hierarchy suggests an obvious
  14. symbol and precedence for such an operator:
  15.  
  16.     bitwise and        &
  17.     bitwise exclusive or    ^
  18.     bitwise inclusive or    |
  19.     logical and        &&
  20.     logical or        ||
  21.  
  22. The logical exclusive or would be represented by ^^ and have
  23. precedence higher than || but lower than && .  If C requires machines
  24. to be able to implement bitwise XOR, then it would seem reasonable to
  25. require the logical operator also.
  26.  
  27. --David M.
  28. "I command you to defy this order."
  29.